package com.acme.multithreadinglab.tracker;

import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;
import java.util.concurrent.ConcurrentHashMap;

public class DelegatingTracker {
	private ConcurrentHashMap<String, Point> concMap;
	private final Map<String, Point> unmodMap;
	
	public DelegatingTracker(final Map<String, Point> m) {
		concMap = new ConcurrentHashMap<String, Point>(m);
		unmodMap = Collections.unmodifiableMap(concMap);
	}

	public Point getLoc(String id) {
		return concMap.get(id); 
	}
	
	public void setLoc(String id, Point point){
		concMap.put(id, point);
	}
	
	public Map<String, Point> getMap () {
		return unmodMap;
	}
}
